import request from '@/utils/request'

// 订单列表
export function getOrderLists(params) {
  return request({
    url: '/OrderApi/lists',
    method: 'get',
    params
  })
}

// 订单列表
export function getOrderAlias(params) {
  return request({
    url: '/OrderApi/orderAlias',
    method: 'get',
    params
  })
}

// 订单详情
export function getOrderDetail(params) {
  return request({
    url: '/OrderApi/detail',
    method: 'get',
    params
  })
}

// 修改身份证号码
export function modifyOrderIdCardNo(data) {
  return request({
    url: '/OrderApi/modifyOrderIdCardNo',
    method: 'post',
    data
  })
}

// 获取骑手信息
export function getKnightInfo(data) {
  return request({
    url: '/PcDeliveryFn/getKnightInfo',
    method: 'post',
    data
  })
}

// 验证密码
export function checkedPayPassword(data) {
  return request({
    url: '/OrderApi/checkedPayPassword',
    method: 'post',
    data
  })
}
// 删除订单
export function delOrder(data) {
  return request({
    url: '/OrderApi/del',
    method: 'post',
    data
  })
}

// 付款
export function payUrl(data) {
  return request({
    url: '/orderApi/payUrl',
    method: 'post',
    data
  })
}
// （原接口）
/* $.post('/Order/pay_url', { hantepay: hantepay, global_alipay_currency: global_alipay_currency, pay_type: payType, order_id
  : order_id, money_type: money_type }, function(data) {
  if (data.status == 1) {
    window.location.href = data.url
  } else {
    $.Error(data.msg)
  }
}) */

// 确认收货
export function userConfirm(data) {
  return request({
    url: '/OrderApi/userConfirm',
    method: 'post',
    data
  })
}

// 再次购买
export function buyAgain(data) {
  return request({
    url: '/OrderApi/buyAgain',
    method: 'post',
    data
  })
}

// 取消换货、取消退货
export function cancleComplain(data) {
  return request({
    url: '/OrderApi/cancleComplain',
    method: 'post',
    data
  })
}

// 取消换货、取消退货申请
export function newRefundCancleComplain(data) {
  return request({
    url: '/OrderApi/new_refund_cancle_complain',
    method: 'post',
    data
  })
}

// 运单查询
export function getExpressInfo(data) {
  return request({
    url: '/OrderApi/getExpressInfo',
    method: 'post',
    data
  })
}

// 上传支付凭证
export function saveOrderVoucher(data) {
  return request({
    url: '/OrderApi/saveOrderVoucher',
    method: 'post',
    data
  })
}

// 电子发票详情
export function geteInvoice(params) {
  return request({
    url: '/OrderApi/eInvoice',
    method: 'get',
    params
  })
}

// 退换货订单详情
export function getComplainDetail(data) {
  return request({
    url: '/Order/complain_detail',
    method: 'get',
    data
  })
}

/**
 * 交易快照
 * @param {*} data
 */
export function reqPostSnapshot(data) {
  return request({
    url: '/orderApi/transactionSnapshot',
    method: 'post',
    data
  })
}

/**
 * 交易快照装修数据
 * @param {*} data
 */
export function transactionSnapshotDiyHtml(params) {
  return request({
    url: '/OrderApi/transactionSnapshotDiyHtml',
    method: 'get',
    params
  })
}

/**
 * 订单结算
 * @param {*} data
 */
export function getOrderBuyData(data) {
  return request({
    url: '/OrderApi/buy',
    method: 'post',
    data
  })
}

/**
 * 拼团订单结算
 * @param {*} data
 */
export function getGroupOrderBuyData(data) {
  return request({
    url: '/GroupShoppingOrderApi/buy',
    method: 'post',
    data
  })
}
/**
 * 订单结算核对优惠码
 * @param {*} data
 */
export function getCouponCodeResult(data) {
  return request({
    url: '/OrderApi/coupon_code_result',
    method: 'post',
    data
  })
}

/**
 * 订单结算定制核对优惠码
 * @param {*} data
 */
export function OPZMcouponCodeDiscount(data) {
  return request({
    url: '"/OrderApi/OPZMcouponCodeDiscount',
    method: 'post',
    data
  })
}

/**
 * 订单结算获取企业列表
 * @param {*} data
 */
export function getLocalEnterpriseSearchByName(data) {
  return request({
    url: '/OrderApi/getLocalEnterpriseSearchByName',
    method: 'post',
    data
  })
}

/**
 * 订单结算获取企业税号
 * @param {*} data
 */
export function getLocalEnterpriseTicketInfo(data) {
  return request({
    url: '/OrderApi/getLocalEnterpriseTicketInfo',
    method: 'post',
    data
  })
}

/**
 * 订单结算门店自提列表
 * @param {*} data
 */
export function selfAddressCount(data) {
  return request({
    url: '/OrderApi/selfAddressCount',
    method: 'post',
    data
  })
}

/**
 * 订单结算提交订单信息
 * @param {*} data
 */
export function addOrder(data) {
  return request({
    url: '/OrderApi/addOrder',
    method: 'post',
    data
  })
}

/**
 * 拼团订单结算提交订单信息
 * @param {*} data
 */
export function GroupShoppingOrder(data) {
  return request({
    url: '/GroupShoppingOrderApi/addOrder',
    method: 'post',
    data
  })
}

/**
 * 订单结算验证身份证
 * @param {*} data
 */
export function idCert(data) {
  return request({
    url: '/Public/idCert',
    method: 'post',
    data
  })
}

/**
 * 订单结算返回离金额最近的一个充值规则
 * @param {*} data
 */
export function lastRuleByPayment(data) {
  return request({
    url: '/RechargeRuleApi/lastRuleByPayment',
    method: 'post',
    data
  })
}

/**
 * 结算页获取运费
 * @param {*} data
 */
export function getPostFee(params) {
  return request({
    url: '/OrderApi/getPostFee',
    method: 'get',
    params
  })
}

/**
 * 结算页获取供应商运费
 * @param {*} data
 */
export function getSupplierPostFee(params) {
  return request({
    url: '/OrderApi/getSupplierPostFee',
    method: 'get',
    params
  })
}

/**
 * 积分购物车运费计算
 * @param {*} data
 */
export function getPointPostFee(params) {
  return request({
    url: '/OrderApi/getPointPostFee',
    method: 'get',
    params
  })
}

// 定制  获取是否需要修改地址
export function getEditOrder(params) {
  return request({
    url: '/Dz/DzYunJiCanOperateOrderAddress',
    method: 'get',
    params
  })
}

/**
 * 定制修改地址
 * @param {*} data
 */
export function DzEditAddress(data) {
  return request({
    url: '/Dz/DzYunJioperateOrderAddressDetail',
    method: 'post',
    data
  })
}

/**
 * 退换货数据获取
 * @param {*} params
 */
export function getOrderRefunding(params) {
  return request({
    url: '/OrderApi/refunding',
    method: 'get',
    params
  })
}

/**
 * 退换货数据提交申请
 * @param {*} params
 */
export function postApplicationSubmission(params) {
  return request({
    url: '/orderApi/applicationSubmission',
    method: 'post',
    params
  })
}

/**
 * 获取周期购订单物流信息
 * @param {*} params
 */
export function cycleLogisticsInfo(params) {
  return request({
    url: '/OrderApi/cycleLogisticsInfo',
    method: 'get',
    params
  })
}

/**
 * 门店服务地址列表
 * @param {*} params params
 */
export function reqPostServeAddrList(params) {
  return request({
    url: '/OrderApi/serveAddressList',
    method: 'post',
    params
  })
}

/**
 * 支付结果
 * @param {*} params params
 */
export function reqGetOrderPayResult(params) {
  return request({
    url: '/OrderApi/payQueryJump',
    method: 'get',
    params
  })
}

// 微信核销商品页面
export function ajaxGetOrderVerifyItem(params) {
  return request({
    url: '/OrderApi/ajaxGetOrderVerifyItem',
    method: 'get',
    params
  })
}

// 订单核销
export function ajaxVerifyItem(data) {
  return request({
    url: '/OrderApi/ajaxVerifyItem',
    method: 'post',
    data
  })
}

// 退货详情的物流
export function getComplainOrderAddress(data) {
  return request({
    url: '/OrderApi/getComplainOrderAddress',
    method: 'post',
    data
  })
}

// 退货详情的编辑物流信息
export function editConplainIrderExpress(data) {
  return request({
    url: '/OrderApi/editConplainIrderExpress',
    method: 'post',
    data
  })
}

// 退货详情
export function getComplainOrderDetail(data) {
  return request({
    url: '/OrderApi/getComplainOrderDetail',
    method: 'post',
    data
  })
}

// 获取物流公司列表
export function getExpressList(data) {
  return request({
    url: '/OrderApi/getExpressList',
    method: 'post',
    data
  })
}

// 获取之前选过的地址
export function selfAddressBefore(data) {
  return request({
    url: '/OrderApi/selfAddressBefore',
    method: 'post',
    data
  })
}

/**
 * 获取门店收款码信息
 * @param {*} data
 */
export function storeGathering(data) {
  return request({
    url: '/OrderApi/storeGathering',
    method: 'post',
    data
  })
}
/**
 * 门店收款码结算提交
 * @param {*} data
 */
export function storeGatheringAddOrder(data) {
  return request({
    url: '/OrderApi/storeGatheringAddOrder',
    method: 'post',
    data
  })
}

// 限购提示
export function getLimitBuyPage(params) {
  return request({
    url: '/ShopApi/getLimitBuyPage',
    method: 'get',
    params
  })
}
// 通联支付 消费申请
export function agentCollectApply(params) {
  return request({
    url: '/TonglianApi/agentCollectApply',
    method: 'get',
    params
  })
}
// 通联支付 充值确认支付
export function depositApply(params) {
  return request({
    url: '/TonglianApi/depositApply',
    method: 'get',
    params
  })
}
// 通联余额确认支付
export function balancePayByBackSMS(data) {
  return request({
    url: '/TonglianApi/balancePayByBackSMS',
    method: 'post',
    data
  })
}
// 通联转赠 获取验证码
export function transferTlBalance(params) {
  return request({
    url: '/UserServiceApi/transferTlBalance',
    method: 'get',
    params
  })
}
// 通联转赠 确认转赠
export function submitTransferTlBalance(data) {
  return request({
    url: '/UserServiceApi/balanceTransferPayByBackSMS',
    method: 'post',
    data
  })
}

// 保存订单回执
export function getReceiptSnapshot(params) {
  return request({
    url: '/OrderApi/gen_receipt_snapshot',
    method: 'get',
    params
  })
}
// 获取商品附带图片
export function getOrderImage(params) {
  return request({
    url: '/OrderApi/getOrderImage',
    method: 'get',
    params
  })
}
// 订单详情修改地址
export function addUpdateOrderAddress(data) {
  return request({
    url: '/OrderApi/addUpdateOrderAddress',
    method: 'post',
    data
  })
}